package chatGUI;

import java.util.ArrayList;

import javax.swing.JList;
import javax.swing.JTabbedPane;

import people.User;

/**
 * <b>Project ChatSystemG2 - INSA 4INFOA1 - 2013/2014</b>
 * <P>
 * <i>Package  chatGUI</i> <br>
 * GUIToCont is an interface. <br>
 * It represents the methods of the controller, in relation with the chatGUI. <br>
 *
 * @author Sergio Gonzalez - Marie-Charlotte Bideaud
 */

public interface GUIToCont {

	/**
	 * Method called when a text message is received : it has to be transfered to the local user
	 * @param user : User
	 * @param tabList : ArrayList<ChatTab>
	 * @return boolean
	 */
	public boolean performMsgReceived (User user, ArrayList<ChatTab> tabList) ;
	
	/**
	 * Method called when a bye message is received : the user concerned is deleted from the userslist
	 * @param user : User
	 * @param tabList : ArrayList<ChatTab>
	 * @param tabbedPane : JTabbedPane
	 */
	public void performDeleteUser (User user, ArrayList<ChatTab> tabList, JTabbedPane tabbedPane) ;
	
	/**
	 * Method called when a file request sent by the local user is refused 
	 * @param user : User
	 * @param tabList : ArrayList<ChatTab>
	 * @return boolean
	 */
	public boolean performRefused (User user, ArrayList<ChatTab> tabList) ;
	
	/**
	 * Method called when a file request sent by the local user is accepted
	 * @param user : User
	 * @param tabList : ArrayList<ChatTab>
	 * @return boolean
	 */
	public boolean performAccepted (User user, ArrayList<ChatTab> tabList) ;
	
	/**
	 * Method called when a hello message is received : the new user has to be added to the userslist
	 * @param userlist : ArrayList<User>
	 * @param list : JList 
	 */
	public void performNewUser (ArrayList<User> userlist, JList list) ;
	
	/**
	 * Method called when a file request is received by the local user
	 */
	public void performFileReceived () ;
	
	/**
	 * Method called when the remote user answers the local user 's file request 
	 * @param user : User
	 */
	public void performAnswerRequest (User user) ;
	
}
